<?php
    require("./Utils.php");

    $post = getJsonParamter();

    $username = $post['username'];

    $conn = getConnection();
    $sql = "DELETE FROM cart WHERE user_id = ?";

    $result = execute($conn, $sql, $username);

    if($result) getJson(200, '清空成功', null);

    else getJson(500, '清空失败', null);
?>